<?php

Loader::using("BusinessLogic::Acaweb::MatriculaAcademica::lib::constraints::AproboMenosDel40PorCientoPeriodoAnterior");
/**
 * Description of MatriculaExecutionPermisionsPlugin
 *
 * @author JeyDotC
 * @export Plugins
 */
class MatriculaExecutionPermisionsPlugin extends AproboMenosDel40PorCientoPeriodoAnterior implements ReplaceTask {

    public function replaceTask() {
        return "index";
    }

    public function willReplaceTask($task) {
        $willReplace = false;

        if ($this->getModule()->getName() == "MatriculaAcademica") {
            $isInPruebaAcademica = !$this->willExecute($this->getModule());
            $this->getModule()->setIsInPruebaAcademica($isInPruebaAcademica);
            
            if($isInPruebaAcademica && $task != "index"){
                $willReplace = true;
            }
        }

        return $willReplace;
    }

}

?>
